//
//  FreshMember-Prefix.pch
//  FreshMember
//
//  Created by qyc on 2019/4/9.
//  Copyright © 2019年 qyc. All rights reserved.
//

#ifndef Const_h
#define Const_h
// 紫色
#define COLOR_MAIN UIColorFromRGB(0x091D15)
// 黑色
#define COLOR_BLACK UIColorFromRGB(0x000000)
// 标题字体
#define kTitleFont      [UIFont systemFontOfSize:15]
// 子标题字体
#define kSubtitleFont      [UIFont systemFontOfSize:13]
// rgb颜色转换（16进制->10进制
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
// 应用程序的屏幕高度
#define kWindowH        [UIScreen mainScreen].bounds.size.height
// 应用程序的屏幕宽度
#define kWindowW        [UIScreen mainScreen].bounds.size.width
// 沙河路径
#define DOCUMENT_DIRECTORY_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]
// 获取系统版本
#define IOS_UIDeviceUUID [[[UIDevice currentDevice] identifierForVendor] UUIDString]
// 获取操作系统
#define CurrentSystemVersion [[UIDevice alloc] init].systemVersion
// 防止循环引用
#define WEAK(weakSelf,self)  __weak __typeof(&*self)weakSelf = self;
// 适配宽度
#define LayoutSize(number) ((number) * (kWindowW / 375))
//#define UI_IS_IPAD              ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
// 判断是否是iPad
#define IS_IPAD              ([[UIDevice currentDevice].model isEqualToString:@"iPad"])
// 判断是否是iphone
#define IS_IPHONE            ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
//判断iPhone5系列
#define IS_IPHONE_5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) && IS_IPHONE : NO)
//判断iPhone6 6s 7系列
#define IS_IPHONE_6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) && IS_IPHONE : NO)
//判断iPhone6p 6sp 7p系列
#define IS_IPHONE_6P ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) && IS_IPHONE : NO)
//判断iPhoneX，Xs（iPhoneX，iPhoneXs）
#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && IS_IPHONE : NO)
//判断iPhoneXr
#define IS_IPHONE_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && IS_IPHONE : NO)
//判断iPhoneXsMax
#define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size)&& IS_IPHONE : NO)

//判断iPhoneX所有系列
#define IS_PhoneXAll (IS_IPHONE_X || IS_IPHONE_Xr || IS_IPHONE_Xs_Max)
#define k_Height_NavContentBar 44.0f
#define k_Height_StatusBar (IS_PhoneXAll? 44.0 : 20.0)
#define k_Height_NavBar (IS_PhoneXAll ? 88.0 : 64.0)
#define k_Height_TabBar (IS_PhoneXAll ? 83.0 : 49.0)
#define k_Height_Nav_Add    (IS_PhoneXAll ? 24.0 : 0)
#define k_Height_TabBar_Add    (IS_PhoneXAll ? 34.0 : 0)
#endif /* Const_h */

/*
 XCode LLVM XXX - Preprocessing中Debug会添加 DEBUG=1 标志
 */
#ifdef DEBUG
#define NSLog(FORMAT, ...) fprintf(stderr,"%s:%d\t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(FORMAT, ...) nil
#endif

